1. Field of the Invention
The present invention relates to managing databases of an active node and a standby node of a main memory database management system, and more particularly, to managing a database so as to prevent data mismatch between an active node and a standby node of a main memory database management system when a transaction is lost due to failure of any one of the active node and the standby node.
2. Description of the Related Art
Since it is essential to process data at high speed in an Internet service system that enables subscribers to have network access or a communication system, a database of the Internet service system or the communication system in which data is stored or managed is required to process data at high speed. Main memory database management systems (MMDBMS) are used for processing data at high speed.
A conventional disk-based database management system (DBMS) is configured such that a table and an index of a database exist in a disk and a data page or an index page to be accessed is read and processed by a memory buffer from the disk. In contrast, an MMDBMS is configured such that a database existing in a disk during initial operation is resident in memory and all data is accessed from the memory, thereby making it possible to process data at high speed.
In general, logging of record changes in a database is executed by a DBMS to ensure stability of the database. Logging is a basic function of a DBMS to record changes such as insert/delete/update in a stable storage device such as a disk in real time. In case of a failure, the recorded actions can be used by the DBMS to return to a final database state.
It is important to ensure not only high speed operation and stability of a database but also durability of the database. A transaction must be atomic, consistent, isolated, and durable (ACID). The term “durability” refers to an ability to ensure that “once a transaction is successfully committed, a result of the transaction is applied to a database even when system failure occurs”.
In order to provide durability, a conventional disk-based DBMS is configured such that when a transaction is committed, all logs of the transaction are permanently flushed to a disk. However, the flushing of logs to the disk that is regarded as a slowest medium degrades the overall performance of the conventional DBMS.
Accordingly, in order to provide better performance and somewhat reduced durability, an MMDBMS is configured such that when a transaction is committed, the transaction is completely committed even when logs of the transaction are flushed to only a memory, and then all logs existing in the memory are permanently flushed to a disk in a process (or thread) different from a process of committing the transaction.
However, in this case, even when the transaction performed by a user is committed, changes to the transaction may be lost in a state where the logs of the transaction are not permanently flushed to the disk.
For example, if unexpected failure occurs due to power failure or operating system (OS) panic in the MMDBMS, since the logs of the transaction are flushed to the memory to be recorded but are not flushed to the disk yet, the transaction may be lost even when the transaction is completely committed.